package gui.typeEditors;

import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

public class IntegerEditor extends NumberEditor<Integer> implements ActionListener, FocusListener
	{
	private static final long serialVersionUID = 9154973446287768715L;

	public IntegerEditor(int initialValue)
		{
		super(initialValue, 1, DEFAULT_COLUMNS, true);
		}

	@Override
	public Integer getValue()
		{
		return (int)value;
		}

	@Override
	protected Integer div(Integer value, Integer divisor)
	{
		return value/divisor;
	}

	@Override
	protected Integer mul(Integer value, Integer factor)
	{
		return value*factor;
	}

	@Override
	protected Integer parse(String text)
	{
		return Integer.parseInt(text);
	}
	}
